// 引入工具类
import http from './config'
// 使用
const URL = 'api-idx/' // 公共前缀地址
export const DatasCenter = {
	// ============================================ 来源数据表定义 ============================================
	findHierarchyName(data) {
		// 查询所属层级简称
		const url = URL+ 'idx/base_data/findHierarchyName'
		return http.get(url, data)
	},
	findThemeName(data) {
		// 查询所属主题简称
		const url = URL+ 'idx/base_data/findThemeName'
		return http.get(url, data)
	},
	base_dataType(data) {
		// 字段分析属性代码下拉项
		const url =
			URL+ 'idx/base_index/queryDict?dictId=base_dataType'
		return http.post(url, data)
	},
	findPageSource(data) {
		// 字段分析属性代码下拉项
		const url = URL+ 'idx/base_data/findPage'
		return http.post(url, data)
	},
	findTableNames(data) {
		// 表名下拉项
		const url = URL+ 'idx/base_data/findTableNames'
		return http.post(url, data)
	},
	getColumns(data) {
		// 列名下拉项
		const url = URL+ 'idx/base_data/getColumns'
		return http.post(url, data)
	},
	expSource(data) {
		// 导出
		const url = URL+ 'idx/base_data/exp'
		return http.exportFile(url, data)
	},
	impSource(data) {
		// 导入
		const url = URL+ 'idx/base_data/imp'
		return http.fileUpload(url, data)
	},
	checkUniqueDefSource(data) {
		// 校验唯一性
		const url = URL+ 'idx/base_data/checkUnique'
		return http.post(url, data)
	},
	saveDefSource(data) {
		// 新增、编辑保存
		const url = URL+ 'idx/base_data/save'
		return http.post(url, data)
	},
	findPageBaseDataRela(data) {
		// 关联结果表查询
		const url = URL+ 'idx/base_data_rela/findPage'
		return http.post(url, data)
	},
	saveBaseDataRela(data) {
		// 关联结果表保存
		const url = URL+ 'idx/base_data_rela/save'
		return http.post(url, data)
	},
	removeDefSource(data) {
		// 删除
		const url = URL+ 'idx/base_data/remove'
		return http.post(url, data)
	},
	// ==========================================基础指标定义 ============================================
	impIndexBase(data) {
		// 导入
		const url = URL+ 'idx/base_index/imp'
		return http.fileUpload(url, data)
	},
	expIndexBase(data) {
		//导出
		const url = URL+ 'idx/base_index/exp'
		return http.exportFile(url, data)
	},
	findPageIndexBase(data) {
		//列表查询
		const url = URL+ 'idx/base_index/findPage'
		return http.post(url, data)
	},
	checkUniqueIndexBase(data) {
		// 保存的数据校验
		const url = URL+ 'idx/base_index/checkUnique'
		return http.post(url, data)
	},
	saveIndexBase(data) {
		// 保存数据
		const url = URL+ 'idx/base_index/save'
		return http.post(url, data)
	},
	findFlexibleModelIndexBase(data) {
		// 获取指标维度
		const url = URL+ 'idx/flexibleModel/findFlexibleModel'
		return http.post(url, data)
	},
	findCaliberAttrIndexBase(data) {
		// 口径属性选择集合
		const url = URL+ 'idx/flexibleModel/findCaliberAttr'
		return http.post(url, data)
	},
	gridQueryIndexBase(data) {
		// 点击表格获取数据
		const url = URL+ 'idx/index_caliber/gridQuery'
		return http.post(url, data)
	},
	checkUniqueCaliber(data) {
		// 口径校验
		const url = URL+ 'idx/index_caliber/checkUnique'
		return http.post(url, data)
	},
	saveCaliber(data) {
		// 口径校验
		const url = URL+ 'idx/index_caliber/save'
		return http.post(url, data)
	},
	toFormIndexBase(data) {
		// 基础指标获取回显数据
		const url = URL+ 'idx/base_index/toForm'
		return http.post(url, data)
	},
	queryDictIndexBase(data) {
		//
		const url = URL+ 'idx/base_index/queryDict'
		return http.post(url, data)
	},
	findGridIndexBase(data) {
		// addCaliber里的获取表格
		const url = URL+ 'idx/flexibleModel/findGrid'
		return http.post(url, data)
	},
	findTreeIndexBase(data) {
		const url = URL+ 'idx/flexibleModel/findTree'
		return http.post(url, data)
	},
	findPageBaseData(data) {
		// 公式列表
		const url = URL+ 'idx/base_data/findPage'
		return http.post(url, data)
	},
	removeIndexBase(data) {
		// 公式列表
		const url = URL+ 'idx/base_index/remove'
		return http.post(url, data)
	},
	/////////////////////////////口径//////////////////////////////////
	findPageCaliber(data) {
		// 口径列表
		const url = URL+ 'idx/index_caliber/findPage'
		return http.post(url, data)
	},
	impCaliber(data) {
		// 口径导入
		const url = URL+ 'idx/index_caliber/imp'
		return http.fileUpload(url, data)
	},
	expCaliber(data) {
		// 口径导出
		const url = URL+ 'idx/index_caliber/exp'
		return http.exportFile(url, data)
	},
	removeCaliber(data) {
		// 口径删除
		const url = URL+ 'idx/index_caliber/remove'
		return http.post(url, data)
	},
	//////////////////////////////维度配置///////////////////////////////////
	findPageFlexibleModel(data) {
		// 维度配置查询
		const url = URL+ 'idx/flexibleModel/findPage'
		return http.post(url, data)
	},
	checkUniqueFlexibleModel(data) {
		const url = URL+ 'idx/flexibleModel/checkUnique'
		return http.post(url, data)
	},
	saveFlexibleModel(data) {
		// 维度配置保存
		const url = URL+ 'idx/flexibleModel/save'
		return http.post(url, data)
	},
	removeFlexibleModel(data) {
		// 维度配置删除
		const url = URL+ 'idx/flexibleModel/remove'
		return http.post(url, data)
	},
	referenchCheckFlexibleModel(data) {
		// 维度配置删除校验
		const url = URL+ 'idx/flexibleModel/referenceCheck'
		return http.post(url, data)
	},
	/////////////////////////////////////指标结果查询/////////////////////////////////////////////
	getAllCurrencyIndexResult(data) {
		//  获取所有币种
		const url = URL+ 'idx/index_result/getAllCurrency'
		return http.get(url, data)
	},
	findOrgTreeIndexResult(data) {
		// 获取机构列表
		const url = URL+ 'idx/index_result/findOrgTree'
		return http.get(url, data)
	},
	findPageIndexResult(data) {
		// 获取查询
		const url = URL+ 'idx/index_result/findPage'
		return http.post(url, data)
	},
	 // 查询所有星型关系
     getTable(data) {
		const url = URL+ 'idx/base_data_rela/getTable'
		return http.get(url, data)
	 },
	///////////////////////////////////////////////////应用指标定义///////////////////////////////////////////////
	findFlexibleModelDefApplication(data) {
		// 指标维度-选项
		const url = URL+ 'idx/flexibleModel/findFlexibleModel'
		return http.post(url, data)
	},
	findPageDefApplication(data) {
		// 通用查询-主表格
		const url = URL+ 'idx/derive_index/findPage'
		return http.post(url, data)
	},
	saveDefApplication(data) {
		//校验
		const url = URL+ 'idx/derive_index/checkUnique'
		return http.post(url, data)
	},
	checkUniqueSaveDefApplication(data) {
		//提交
		const url = URL+ 'idx/derive_index/save'
		return http.post(url, data)
	},
	baseIndexDefFindPageApplication(data) {
		//基础指标查询
		const url = URL+ 'idx/base_index/findPage'
		return http.post(url, data)
	},
	deriveIndexDefFindPageApplication(data) {
		//应用指标查询
		const url = URL+ 'idx/derive_index/findPage'
		return http.post(url, data)
	},
	removeApplication(data) {
		//应用指标查询
		const url = URL+ 'idx/derive_index/remove'
		return http.post(url, data)
	},
	importApplication(data) {
		//应用指标导入
		const url = URL+ 'idx/derive_index/imp'
		return http.fileUpload(url, data)
	},
	exportApplication(data) {
		//应用指标导出
		const url = URL+ 'idx/derive_index/exp'
		return http.exportFile(url, data)
	},
}